package com.bitmm.itsalon.spring.xml.web;

import com.bitmm.itsalon.spring.xml.web.bean.HelloBean;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest {

    public static void main(String[] args) {
        //获取spring的上下文对象
        BeanFactory context =
                new ClassPathXmlApplicationContext("classpath:beans.xml");
        //我们的对象都在spring中管理，如果要使用，
        //直接取出来即可。
        HelloBean helloBean = (HelloBean) context.getBean("helloBean");
        helloBean.sayHello();
        System.out.println(helloBean);
        System.out.println("hello");
    }

}